package net.lastcoder.ifserver.server;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

/**
 * auth: WenYF
 * date: 2016/11/23
 */
public class ServerCodecFactory implements ProtocolCodecFactory {

    private ServerEncoder encoder = new ServerEncoder();
    private ServerDecoder decoder = new ServerDecoder();

    @Override
    public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception {
        return encoder;
    }

    @Override
    public ProtocolDecoder getDecoder(IoSession ioSession) throws Exception {
        return decoder;
    }
}
